/*
package security.controller;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

*/
/**
 * @program: check-repetition
 * @description:
 * @author: hjk
 * @create: 2021-07-16 15:28
 **//*

@RestController
public class TestController {

    @GetMapping("/security/hello")
    public String test() {
        System.out.println("============");
        return "success";
    }

    public static void main(String[] args) {
        // 创建密码解析器
        PasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();
        // 对密码进行加密
        String atguigu = bCryptPasswordEncoder.encode("atguigu");
        // 打印加密之后的数据
        System.out.println("加密之后数据：\t" + atguigu);
        boolean b = bCryptPasswordEncoder.upgradeEncoding(atguigu);
        System.out.println("-------->" + b);
        //判断原字符加密后和加密之前是否匹配
        boolean result = bCryptPasswordEncoder.matches("atguigu", atguigu);
        // 打印比较结果
        System.out.println("比较结果：\t" + result);
    }
}
*/
